#include "TxResourceManager.h"

TxResourceManager* TxResourceManager::manager = NULL;

TxResourceManager::TxResourceManager()
{
}

TxResourceManager::~TxResourceManager()
{
}

TxResourceManager* TxResourceManager::getResoureceManager()
{
	if(!manager)
	{
		manager = new TxResourceManager();
	}
	return manager;
}

CIw2DImage*	TxResourceManager::addImage(const char* fileName)
{
	images[fileName] = Iw2DCreateImage(fileName);
	return images[fileName];
}

void TxResourceManager::cleanManager()
{
	for(std::map<const char*, CIw2DImage*>::iterator it = images.begin(); it != images.end(); it++)
	{
		delete it->second;
	}
	images.clear();
	delete manager;
}